import type { IGoodsDetail, TCategoryDetail } from '@/types/category'
import { http } from '@/utils/http'

class CategoryAPI {
  /**
   * @returns 分类-分类总数据
   */
  public static getCatoryList() {
    return http<TCategoryDetail[]>({
      url: '/category/top',
      method: 'GET',
    })
  }
  /**
   * @return 获取商品详情
   * @params id 商品id
   */
  public static getGoodsDetail(id: string) {
    return http<IGoodsDetail>({
      url: '/goods',
      method: 'GET',
      data: {
        id,
      },
    })
  }
}

export default CategoryAPI
